package com.cpz.knife4j.controller.front;

import com.cpz.knife4j.constant.Constant;
import com.cpz.knife4j.result.Result;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @author cpz
 * @since 2022/10/12
 */
@Api(tags = "评论-前端")
@RestController("/comment")
public class CommentController extends FrontBaseController {

    @Operation(summary = "获取header中的"+ Constant.TOKEN_FRONT)
    @GetMapping("/find")
    public String find(@ApiIgnore @RequestHeader(value = Constant.TOKEN_FRONT, required = false) String token) {
        return String.valueOf(token);
    }

    @Operation(summary = "模拟登录")
    @PostMapping("/login")
    public Result<String> login() {
        return new Result<>(200, "1314=o(^_^)o", "登录成功");
    }
}
